﻿using client.communication;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace client
{
    public partial class MainGameForm : Form
    {
        public MainGameForm()
        {
            InitializeComponent();
            pictureBox1.SendToBack();
        }

        

        

        private  void MainGameForm_Load(object sender, EventArgs e)
        {
            
        
            /*pictureBox = new PictureBox();
            pictureBox.Location = new Point(0, 0);
            pictureBox.Show();*/
         
            SyncServerGamingDataTask syncServerGamingDataTask = new SyncServerGamingDataTask("localhost",18899,this);


            Task.Run(async ()=> {
                await syncServerGamingDataTask.run();
            });
        }

        int index = 0;

        private void timer_Tick(object sender, EventArgs e)
        {


        //    index = (index + 1) % imageList.Count;

         //   pictureBox2.BackgroundImage = imageList[index];


            //timer.Stop();
            // 强制控件重绘
            //pictureBox2.Invalidate();

        }

        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {

        }
    }
}
